layui.use(['form'], function () {
    var $ = layui.jquery;
    var form = layui.form,
        layer = layui.layer,
        layuimini = layui.layuimini;

    /**
     * 初始化表单，要加上，不然刷新部分组件可能会不加载
     */
    form.render();

    // 当前弹出层，防止ID被覆盖
    var parentIndex = layer.index;

    // 进行修改操作
    form.on('submit(saveBtn)', function (data) {
        data = data.field;
        var index = layer.load(2);
        var url = "/web/boSpaceUser/updateStatus";
        $.post(url, data, function(res){
            if(res.state == "200"){
                layer.msg(res.message, {icon: 1});
            }else{
                layer.msg(res.message, {icon: 2});
            }
            layer.close(index);
            layer.close(parentIndex);
        }, 'json');
        return false;
    });

    $("#closeBtn").on("click", function(){
        // 关闭弹出层
        layer.close(parentIndex);
    });
});